package org.example.com.Bean;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.example.com.util.StringUtil;

import java.security.NoSuchAlgorithmException;

@Data
@TableName(value = "user")
public class User {
    private String id;
    private String username;
    private String password;
    private String phone;
    private String email;
    private String address;
    private Integer status;
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    @TableField(fill = FieldFill.UPDATE)
    private String updateTime;
    private Integer isDeleted;
    private Integer isAdmin;
    private Integer score;
    public void setPassword(String password) throws NoSuchAlgorithmException {
        this.password = StringUtil.encryptMD5(password);
    }
}
